//
//  SRBLeService+Desc.m
//  CareRing
//
//  Created  on 2024/12/12.
//
    

#import "CABLeService+Desc.h"
#import "ConfigModel.h"
#import "CADeviceInfo+description.h"

@implementation CABLeService (Desc)

-(NSString *)boradCastInfomations
{
    NSMutableString *infoString = [NSMutableString new];
    
    [infoString appendFormat:@"%@\r\n", self.advDataLocalName];// boradcast name
    
    NSString *cid = [NSString stringWithFormat:@"%@0X%X", _L2(L_TXT_CID), self.cid];
    [infoString appendFormat:@"%@,", cid];// cid
    
    // color
    [infoString appendFormat:@"%@,", [CADeviceInfo colorDesc:self.deviceColor]];
    
    // size
    [infoString appendFormat:@"%@,", [CADeviceInfo sizeDesc:self.deviceSize]];
    // sn
    [infoString appendFormat:@"\r\nSn:%@,", self.snString];
    // charge
    [infoString appendFormat:@"%@,", self.stringOfChargeStatus];
    // power
    [infoString appendFormat:@"%@:%d%%,", _L2(L_TX_PWD), self.scanBatteryLevel.intValue];
    // Generation
    [infoString appendFormat:@"Gen:%lu",  (unsigned long)self.deviceGeneration];

    
    
    return infoString;
}

-(NSString *)stringOfChargeStatus
{
    return self.scanIsCharge.boolValue ? _L2(L_TXT_CHRGING) :_L2(L_TXT_NOTCHARG);
}



@end
